//
//  VideoView.h
//  openEye
//
//  Created by 徐悟源 on 16/4/1.
//  Copyright © 2016年 Wuyuan. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>
#import <AVFoundation/AVFoundation.h>

@class VideoView;

@protocol VideoViewDelegate <NSObject>

@optional

- (void)playerViewZoomButtonClicked:(VideoView *)view;
- (void)playerFinishedPlayback:(VideoView *)view;
- (void)pageBackButtonAction;


@end


@interface VideoView : UIView

@property (nonatomic, weak) id<VideoViewDelegate> delegate;

@property (nonatomic , strong) NSURL *contentURL;

@property (nonatomic , strong) AVPlayer *moviePlayer;

@property (nonatomic , assign) BOOL shouldShowHideParentNavigationBar;

@property (nonatomic , assign) BOOL shouldPlayAudioOnVibrate;

@property (nonatomic , copy) NSString *titleName;

- (instancetype)initWithFrame:(CGRect)frame contentURL:(NSURL *)contentURL;

- (instancetype)initWithFrame:(CGRect)frame playerItem:(AVPlayerItem *)playerItem;

- (void)play;

- (void)pause;

- (void)setupConstraints;


@end
